6edc43a40504ee4e1fdea0a84ff450ea0a0789d4,community/src/main/java/org/neo4j/kernel/IndexManagerImpl.java,IndexManagerImpl,findIndexConfig,#Class#String#Map#Map#,76
Before Change
{
provider = "lucene";
}
indexProvider = getIndexProvider( provider );
configToUse = indexProvider.fillInDefaults( MapUtil.stringMap( KEY_INDEX_PROVIDER, provider ) );
}
else
{
indexProvider = getIndexProvider( configToUse.get( KEY_INDEX_PROVIDER ) );
}
if ( storedConfig != null )
{
if ( suppliedConfig != null && !storedConfig.equals( suppliedConfig ) )
{
throw new IllegalArgumentException( "Supplied index configuration:\n" +
suppliedConfig + "\ndiffer from stored config:\n" + storedConfig +
"\nfor '" + indexName + "'" );
}
configToUse = storedConfig;
}
boolean created = indexStore.setIfNecessary( cls, indexName, configToUse );
return new Pair<Map<String, String>, Boolean>( configToUse, created );
}
private Map<String, String> getOrCreateIndexConfig( Class<? extends PropertyContainer> cls,
After Change
{
// 1. Check stored config (has this index been created previously?)
Map<String, String> storedConfig = indexStore.get( cls, indexName );
if ( storedConfig != null && suppliedConfig == null )
{
return Pair.of( storedConfig, Boolean.FALSE );
}
Map<String, String> configToUse = null;
// 2. Check config supplied by the user for this method call
if ( configToUse == null )
{
configToUse = suppliedConfig;
}
// 3. Check db config properties for provider
if ( configToUse == null )
{
String provider = null;
if ( dbConfig != null )
{
provider = (String) dbConfig.get( "index." + indexName );
if ( provider == null )
{
provider = (String) dbConfig.get( "index" );
}
}
// 4. Default to lucene
if ( provider == null )
{
provider = "lucene";
}
IndexProvider indexProvider = getIndexProvider( provider );
configToUse = indexProvider.fillInDefaults( MapUtil.stringMap( KEY_INDEX_PROVIDER, provider ) );
}
// Do they match (stored vs. supplied)?
if ( storedConfig != null )
{
if ( suppliedConfig != null && !storedConfig.equals( suppliedConfig ) )
{
throw new IllegalArgumentException( "Supplied index configuration:\n" +
suppliedConfig + "\ndiffer from stored config:\n" + storedConfig +
"\nfor '" + indexName + "'" );
}
configToUse = storedConfig;
}
boolean created = indexStore.setIfNecessary( cls, indexName, configToUse );
return new Pair<Map<String, String>, Boolean>( Collections.unmodifiableMap( configToUse ), created );
}
private Map<String, String> getOrCreateIndexConfig( Class<? extends PropertyContainer> cls,